package com.ht.pms.core.dto;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.ht.ussp.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author 喻尊龙
 * @since 2018-12-12
 */
@ApiModel
@TableName("t_apply_reimbursement_process")
public class ApplyReimbursementProcess extends Model<ApplyReimbursementProcess> implements Comparable<ApplyReimbursementProcess> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
	@TableId(value="id", type= IdType.AUTO)
	@ApiModelProperty(required= true,value = "主键")
	private Integer id;
    /**
     * 申请编号
     */
	@TableField("approve_id")
	@ApiModelProperty(required= true,value = "申请编号")
	private String approveId;
    /**
     * 审批时间
     */
	@TableField("approve_time")
	@ApiModelProperty(required= true,value = "审批时间")
	private Date approveTime;
    /**
     * 审批角色id
     */
	@TableField("approve_user_id")
	@ApiModelProperty(required= true,value = "审批角色id")
	private String approveUserId;
    /**
     * 审批角色名称
     */
	@TableField("approve_user_name")
	@ApiModelProperty(required= true,value = "审批角色名称")
	private String approveUserName;
    /**
     * 审批顺序
     */
	@TableField("aprove_index")
	@ApiModelProperty(required= true,value = "审批顺序")
	private String aproveIndex;
    /**
     * 审批角色岗位
     */
	@TableField("approve_user_postition")
	@ApiModelProperty(required= true,value = "审批角色岗位")
	private String approveUserPostition;
    /**
     * 创建时间
     */
	@TableField("create_time")
	@ApiModelProperty(required= true,value = "创建时间")
	private Date createTime;
    /**
     * 修改时间
     */
	@TableField("update_time")
	@ApiModelProperty(required= true,value = "修改时间")
	private Date updateTime;


	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getApproveId() {
		return approveId;
	}

	public void setApproveId(String approveId) {
		this.approveId = approveId;
	}

	public Date getApproveTime() {
		return approveTime;
	}

	public void setApproveTime(Date approveTime) {
		this.approveTime = approveTime;
	}

	public String getApproveUserId() {
		return approveUserId;
	}

	public void setApproveUserId(String approveUserId) {
		this.approveUserId = approveUserId;
	}

	public String getApproveUserName() {
		return approveUserName;
	}

	public void setApproveUserName(String approveUserName) {
		this.approveUserName = approveUserName;
	}

	public String getAproveIndex() {
		return aproveIndex;
	}

	public void setAproveIndex(String aproveIndex) {
		this.aproveIndex = aproveIndex;
	}

	public String getApproveUserPostition() {
		return approveUserPostition;
	}

	public void setApproveUserPostition(String approveUserPostition) {
		this.approveUserPostition = approveUserPostition;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "ApplyReimbursementProcess{" +
			", id=" + id +
			", approveId=" + approveId +
			", approveTime=" + approveTime +
			", approveUserId=" + approveUserId +
			", approveUserName=" + approveUserName +
			", aproveIndex=" + aproveIndex +
			", approveUserPostition=" + approveUserPostition +
			", createTime=" + createTime +
			", updateTime=" + updateTime +
			"}";
	}

	@Override
	public int compareTo(ApplyReimbursementProcess o) {
		if(o.getCreateTime()==null){
			return 1;
		}
		if(this.createTime==null){
			return 1;
		}
		return Integer.parseInt(DateUtil.getDiffSeconds(o.getCreateTime(),this.createTime)+"");
	}
}
